package cn.chinaunicom.service.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Properties;

@Slf4j
@Component
public class MyApplicationRunner implements ApplicationRunner {

/*    @Value("${vdns.addr}")
    private String CONF_PATH;*/
    @Override
    public void run(ApplicationArguments args) throws Exception {
//        log.info("this is MyApplicationRunner ApplicationRunner初始化...");
//        log.info("CONF_PATH===" + CONF_PATH);
//        loadHost(CONF_PATH);
    }

/*    public static void loadHost(String addr) throws IOException {
        Resource resource = new ClassPathResource(addr);
        Properties props = PropertiesLoaderUtils.loadProperties(resource);
        JavaHost.updateVirtualDns(props);
    }*/

}